<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form action="login" method="post">
        <table>
            <tr>
                <td>用户名：</td>
                <td><input type="text" name="uname"></td>
            </tr>
            <tr>
                <td>密码:</td>
                <td><input type="text" name="pwd"></td>
            </tr>
            <tr>
                <td>验证码</td>
                <td><input type="text" name="code"> <img src="validateCode" alt=""> <a href="#">看不清</a></td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" value="提交"></td>
            </tr>
        </table>
        <script>
            var link = document.querySelector("a");
            var codeImg = document.querySelector("img");
            link.onclick=function (ev) {
                codeImg.src="validateCode?n="+Math.random();
            }
        </script>
    </form>
</body>
</html>